<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>在浏览器中window就是该全局对象为[object Window]</title>
</head>

<body>
    <h2>JavaScript <b>this</b> 关键字</h2>
    <p>实例中，<b>this</b> 指向了 window 对象:</p>
    <p id="demo"></p>
    <script>
        var x = this;
        document.getElementById("demo").innerHTML = x;
    </script>

</body>

</html>